Control unit for a machine with a tapping function

ABSTRACT

A control unit enables tapping onto an end surface of a workpiece while rotating the workpiece. A workpiece rotational speed command (Vc) is applied from an NC unit (90) to first and second speed control circuits (111, 121) of first and second control circuits (110, 120), to operate these control circuits in a speed control mode, so that the workpiece (70) and a tapper (80) respectively mounted on first and second main spindles (10, 20) are caused to rotate at the same speed by first and second main spindle motors (11, 21). When an error pulse amount corresponding to a workpiece rotational speed command is set in an error register (123) of the second control circuit, the second control circuit operates in a tapping mode to execute speed loop processing in accordance with a speed command calculated by position loop processing executed on the basis of a movement command, equal to the sum of the workpiece rotational speed command and a tapping speed command (Uv), and a positional feedback signal (PPC) indicative of an actual tapper rotational position, so that the tapper is rotated relative to the workpiece at a predetermined tapping speed. The tapper is axially moved toward the workpiece, whereby tapping onto the end surface of the workpiece is conducted.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a control unit for use with a machinehaving main spindles for workpiece rotation and tool rotation andprovided with a tapping function, and more particularly, to a controlunit for controlling the drive of main spindles so as to achieve tappingonto an end face of a rotating workpiece.

2. Description of the Related Art

In a machine of a type having main spindles respectively for workpiecerotation and for tool rotation, e.g., a compound lathe such as a turningcenter, a series of machining operations is implemented in succession.For instance, tapping is made onto an end face of a workpiece aftercutting onto the peripheral face of the workpiece is performed, and thenanother cutting operation is carried out. In this case, generally, uponcompletion of the first cutting operation, the rotation of the workpieceis decelerated and stopped, and then the tapping is started. Further,upon completion of the tapping operation, the rotation of the workpieceis started and is then accelerated until a predetermined rotationalspeed suited for the second cutting operation is reached.Conventionally, therefore, it is impossible to effect machining whichrequires workpiece rotation simultaneously with tapping. Moreover, theworkpiece rotation must be decelerated and stopped before the start oftapping, and the workpiece rotation must be restarted and acceleratedafter completion of tapping. As a result, a total machining timerequired for a series of machining operations is prolonged, leading tolower machining efficiency.

SUMMARY OF THE INVENTION

An object of the present invention is to provide a control unit capableof controlling the drive of a machine having main spindles for workpiecerotation and for tool rotation and provided with a tapping function, ina manner permitting tapping onto an end surface of a rotating workpiece.

To achieve the above-mentioned object, according to the presentinvention, there is provided a control unit for use with a machine, witha tapping function, which is arranged to rotatively drive a first mainspindle adapted to be mounted with a workpiece by a first motor, androtatively drive a second main spindle adapted to be mounted with atapping tool by a second motor, and axially drive the latter spindle bya third motor.

The control unit comprises: a position detector coupled to the secondmain spindle; a first control circuit for controlling rotation of thefirst motor in accordance with a workpiece rotational speed commandsupplied from a host controller; a second control circuit forperiodically executing position control processing in accordance with atool rotational speed command supplied from the host controller and apositional feedback signal, indicative of an actual rotational positionof the tool, supplied from the position detector to thereby periodicallycalculate a tool rotational speed command during the workpiece rotation,and for periodically executing speed control processing in accordancewith the thus calculated speed command to thereby control rotation ofthe second motor; and a third control circuit for controlling rotationof the third motor in accordance with a tool axial moving speed commandsupplied from the host controller and corresponding to the toolrotational speed command.

According to the present invention, as described above, during theworkpiece rotation effected in accordance with a workpiece rotationalspeed command, speed control processing is periodically executed inaccordance with a tool rotational speed command during the workpiecerotation which is determined by position control processing periodicallycarried out in accordance with a tool rotational speed command and anactual tool rotational position, whereby the second motor for tool driveis so driven as to rotate the tool at a speed equal to a sum of a targetworkpiece rotational speed and a target tool rotational speed. Thus, itis possible to simultaneously rotate the workpiece and the tool with aspeed difference corresponding to the tool rotational speed command.Further, during the simultaneous workpiece and tool rotation, the toolis moved axially in accordance with the tool axial moving speed commandcorresponding to the tool rotational speed command. This makes itpossible to effect tapping onto an end surface of the workpiece with useof a tapping tool while the workpiece is rotating. Thus, tapping can beperformed without stopping the workpiece rotation. Therefore, ifnecessary, tapping can be made simultaneously when cutting onto aperipheral surface of the workpiece is made, for instance. This makes itpossible to significantly reduce a total time required for machining.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view showing a compound lathe equipped with acontrol unit according to an embodiment of the present invention; and

FIG. 2 is a flowchart showing position control loop processing and speedcontrol loop processing associated with a second main spindle, which areexecuted by the processor of the second control circuit shown in FIG. 1.

DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring to FIG. 1, a compound lathe, having a function of a tappingunit, is provided with a first main spindle 10 arranged to be rotatable,a second main spindle 20 disposed in alignment with the first mainspindle 10 and arranged to be rotatable and axially movable, and a toolrest 60 arranged for reciprocal motion in the axial direction of thespindles 10 and 20 and in the direction perpendicular thereto.

The first main spindle 10 is operatively coupled to a first main spindlemotor 11 through a first gearing mechanism 12 consisting of, e.g., apair of gears with a gear ratio of 1:n, so that the main spindle 10rotates 1/n revolutions during one revolution of the motor 11. The firstmain spindle motor 11 is mounted with a first speed detector 14 fordetecting an actual motor speed. A chuck 13 for detachably holding aworkpiece 70 is mounted on one end of the first main spindle 10.

The second main spindle 20 is operatively coupled to a second mainspindle motor 21 through a second gearing mechanism 22 similar to thefirst gearing mechanism 12 with a gear ratio of 1:m. The main spindlemotor 21 is equipped with a second speed detector 24 similar to thefirst speed detector 14. The second main spindle 20 has at its oppositeends respectively coupled to a chuck 23 for detachably holding a tapper(tapping tool) 80 and a position coder 25. The position coder 25 isarranged to generate a feedback pulse each time the second main spindle20 rotates a predetermined angle. Further, the second main spindle 20 isconnected to a third motor 31 through a third gearing mechanism 32, sothat the second main spindle 20 reciprocates axially as the third motor31 rotates in the forward and reverse directions. Reference numeral 33indicates a position detector.

A tool rest 60 is coupled to fourth and fifth motors 41 and 51 throughfourth and fifth gearing mechanisms 42 and 52, respectively, so that thetool rest 60 reciprocates in the axial direction of the first and secondmain spindles 10 and 20 and in the direction perpendicular thereto asthe motors 41 and 51 rotate in the forward and reverse directions.Reference numerals 43 and 53 indicate position detectors.

The compound lathe is equipped with a control unit 100 of an embodimentof the present invention. The control unit 100 is operable in either oneof operating modes under the control of a host controller such as anumerical control unit 90 which has a processor (hereinafter referred toas NC processor) 91. The operating modes of the control unit 100 includea speed control mode for separately and independently controlling therotational speeds of the first and second main spindles 10 and 20, and atapping mode for performing a tapping operation while correlativelycontrolling the rotational speeds of these main spindles. In the speedcontrol mode, only the first main spindle 10 or both of the first andsecond main spindles 10 and 20 can be rotated. The control unit 100 isequipped with first to fifth control circuits, 110, 120, 130, 140, and150 accommodating therein microprocessors (hereinafter referred to asfirst to fifth processors), not shown, for controlling the first andsecond main spindle motors 11 and 21, and the third, fourth, and fifthmotors 31, 41, and 51.

Functionally, the first control circuit 110 includes a speed controlcircuit 111 connected to the NC processor 91 and the first speeddetector 14. Namely, the first processor of the first control circuit110 is arranged to perform speed loop control for the first main spindlemotor 11 in accordance with a workpiece rotational speed command Vcperiodically supplied from the NC processor 91 at intervals of apredetermined pulse distribution cycle ITP and a speed feedback signalsupplied from the first speed detector 14 and indicative of an actualworkpiece rotational speed, to thereby cause the first main spindle 10to rotate at a rotational speed Vc/n.

Functionally, the second control circuit 120 is provided with a speedcontrol circuit 121, a position counter 122, an error register 123,first to third converter sections 124a-124c, first and secondmultipliers 125 and 126, an adder 127, a subtracter 128, and first tothird switches SW1-SW3. Namely, the second processor of the secondcontrol circuit 120 is designed to achieve functions of correspondingones of the elements 121-128, and SW1-SW3. The position counter 122, theerror register 123, the second multiplier 126, etc. constitute aposition control circuit.

More specifically, the first multiplier 125 is arranged to multiply aratio m/n of the gear ratio of the first gearing mechanism 12 to thegear ratio of the second gearing mechanism 22 by the workpiecerotational speed command Vc supplied from the NC unit 90, to therebyperiodically generate a tapper rotational speed command Vc(s) forrotating the tapper 80 at the same speed as the workpiece rotationalspeed at intervals of the same cycle as the pulse distribution cycleITP. An output terminal of the first multiplier 125 is connected to afirst stationary contact a of the first switch SW1, and to inputterminals of second and third converter sections 124b and 124c.

The second and third converter sections 124b and 124c are designed toconvert the output Vc(s) of the first multiplier 125 into acorresponding moving command and into a corresponding error pulse amount(positional deviation amount), respectively. Output terminals of theseconverter sections are respectively connected to a first input terminalof the adder 127 and an input side of the second switch SW2. An errorpulse amount calculated by the third converter section 124c is equal toa value (Vc(s)/(ITP×PG)) obtained by dividing the output Vc(s) of thefirst multiplier 125 by the product of the pulse distribution cycle ITPand the multiplying factor (positional loop gain) of the secondmultiplier 126. The first converter section 124a is designed to converta tapping speed command Uv, periodically delivered from the NC unit 90at intervals of the same cycle as the pulse distribution cycle ITP, intoa tapping moving command. An output terminal of the first convertersection is connected to a second input terminal of the adder 127.

The position counter 122 is arranged to count a positional feedbackpulse signal PPC supplied from the position coder 25 and indicative ofan actual rotational position of the second main spindle 20, to therebycalculate an amount of change in a count value produced between adjacentpulse distributing cycles, the amount of change indicating an actualmovement of the second main spindle 20 in one pulse distribution cycleITP. An output terminal of the position counter 122 is connected to anegative input terminal of the subtracter 128. The subtracter 128 has apositive input terminal connected to an output terminal of the adder127, and an output terminal connected to a first input terminal of theerror register 123 through the third switch SW3. A second input terminalof the error register 123 is connected to the third converter section124c via the second switch SW2, and the output terminal of the errorregister 123 is connected to the speed control circuit 121 via thesecond multiplier 126 and the first switch SW1.

In the following, the operation of the compound lathe of FIG. 1 will beexplained.

In normal machining, e.g., machining of a peripheral surface of aworkpiece, the first and second control circuits 110 and 120 operate inthe speed control mode. Namely, the speed control circuit 111 of thefirst control circuit carries out speed loop control in accordance withthe workpiece rotational speed command Vc supplied from the NC unit 90and the speed feedback signal supplied from the first speed detector 14,to thereby rotate the first main spindle motor 11 at the speed Vc, sothat the first main spindle 10 and the workpiece 70 rotate at the speedVc/n. At the same time, the fourth and fifth motors 41 and 51 are drivenby the fourth and fifth control circuits 140 and 150, so that the toolrest 60 and a machining tool (not shown) mounted thereon move in thedirection parallel to the workpiece axis and in the directionperpendicular thereto, whereby the peripheral surface of the workpieceis machined.

During the machining operation, a movable contact of the first switchSW1 is changed to its neutral position, so that the speed controlcircuit 121 is isolated from other elements of the second controlcircuit 120. As a result, no substantial speed loop processing isconducted by the speed control circuit 121 of the second control circuit120, and hence the second main spindle motor 21 and the second mainspindle 20 are kept stopped. Similarly, the third control circuit 130 isrendered to be inoperative, whereby the axial movement of the secondmain spindle 20 is prevented.

In case that a tapping process is carried out subsequently to orsimultaneously with an ordinary machining process, the tapping processis implemented without stopping the workpiece rotation. In this case,when a program sentence commanding a preparatory job prior to start ofthe tapping process is read from a machining program, an automatic toolexchanger (not shown) and the third control circuit 130 are operatedunder the control of the NC unit 90. More specifically, a drill (notshown) is mounted on the chuck 23 of the second main spindle 20 by thetool exchanger, then the third motor 31 is driven by the third controlcircuit 130 so that the drill mounted on the second main spindle 20axially moves toward the workpiece 70, whereby a starting hole fortapping is formed in an end surface of the workpiece 70. Next, the drillmounted on the chuck 23 is replaced by the tapper 80 by the toolexchanger. Further, the movable contact of the first switch SW1 of thesecond control circuit 120 is switched to the first stationary contacta.

As a result, the tapper rotational speed command Vc(s), which is equalto the product Vc·m/n of the workpiece rotational speed command Vc and aratio m/n, is applied to the speed control circuit 121 from the firstmultiplier 125 via the first switch SW1. The speed control circuit 112carries out the speed loop processing on the basis of the tapperrotational speed command Vc(s) and the speed feedback signal suppliedfrom the second speed detector 24, to cause the second main spindlemotor 21 to rotate at the speed Vc(s). As a result, the tapper 80installed on the second main spindle 20 is caused to rotate at the samespeed as the workpiece rotational speed Vc/n.

Thereafter, when a rigid tapping command is read from the machiningprogram, the first and second control circuits 110 and 120 operate inthe tapping mode. At this time, the first control circuit 110 operatesin the same manner as in the speed control mode, and the workpiece 70continues to rotate at the speed Vc/n. In the second control circuit120, the first switch SW1 is switched to the second stationary contact bside, the third switch SW3 is closed, and the second switch SW2 isclosed temporarily. As a result, the position loop control and the speedloop control are carried out in the second control circuit 120.

More specifically, when the second switch SW2 is closed, an error pulseamount (Vc(s)/(ITP×PG)) supplied from the third converter section 124cand corresponding to the first multiplier output Vc(s) is set in theerror register 123. In the adder 127, a tapping movement command,supplied from first converter section 124a and corresponding to, e.g., apositive tapping speed command Uv, and a movement command, supplied fromthe second converter section 124b and corresponding to the firstmultiplier output Vc(s), are added together. An output data, suppliedfrom the position counter 122 and indicative of an actual movement ofthe second main spindle 20 per one pulse distribution cycle, issubtracted from the added value in the subtracter 128, and thesubtracted result is added via the third switch SW3 to a stored value ofthe error register 123. Further, in the second multiplier 126, an outputof the error register 123 is multiplied by the position gain PG. Theoutput of the second multiplier 126 indicative of the multiplied result,which is calculated as described above in the position control circuitof the second control circuit 120, is substantially equal to the sum ofthe workpiece rotational speed command Vc and the tapper rotationalspeed command Vc(s). The output of the second multiplier is applied, asa tapper rotational speed command during the workpiece rotation, to thespeed control circuit 121 via the first switch SW1.

The speed control circuit 121 performs the speed loop processing inaccordance with the tapper rotational speed command (Vc(s)+Uv) duringthe workpiece rotation and the speed feedback signal from the secondspeed detector 24, thus rotating the second main spindle motor 21 at thespeed (Vc(s)+Uv). As a result, the tapper 80 mounted on the second mainspindle 20 rotates at a speed which is different from the workpiecerotational speed Vc/n by a predetermined tapper rotational speed Uv/m,e.g., at a speed which is faster than the workpiece rotational speed bythe speed Uv/m. In other words, the tapper 80 rotates at a predeterminedtapper rotational speed relative to the workpiece 70.

While the tapper 80 is rotating, e.g., a positive tapper axial movingspeed command Uz, which is determined by the tapping speed command Uvand a tapping pitch (pitch of a thread to be machined), is supplied fromthe NC unit 90 to the third control circuit 130, so that the tapper 80axially moves at a speed corresponding to the speed command Uz towardthe workpiece 70 via the third motor 31, whereby accurate rigid tappingonto an end surface of the workpiece 70 is performed.

Thereafter, when the tapping to a predetermined depth is completed, thetapping speed command Uv of a value "0" is delivered to the secondcontrol circuit 120, and the tapper axial moving speed command Uz of avalue "0" is delivered to the third control circuit 130. In response to"0" tapping speed command Uv, the second control circuit 120 operates inthe same manner as it does during the tapping process mentioned above.This causes the tapper 80 to rotate at the same speed as the workpiecerotational speed. Further, the axial movement of the tapper 80 isstopped under the control of the third control circuit 130.

Then, e.g., a negative tapping speed command Uv, which is the same inmagnitude as and opposite in sign from, e.g., a positive tapping speedcommand Uv delivered during the aforementioned tapping process, isdelivered from the NC unit 90 to the second control circuit 120. At thesame time, e.g., a negative tapper axial moving speed command Uz, whichis the same in magnitude as and opposite in sign from a positive tapperaxial moving speed command Uz delivered during the tapping process, isdelivered from the NC unit 90 to the third control circuit 130. In thiscase, the second and third control circuits 120 and 130 operate in thesame manner as in the tapping process. As a result, the second mainspindle motor 21 rotates at a speed (Vc(s)-Uv), and the tapper 80rotates in the direction opposite from the rotational direction in thetapping at a speed which is different from the workpiece rotationalspeed by a predetermined tapper rotational speed, e.g., at a speed whichis slower than the workpiece rotational speed by the predeterminedtapper rotational speed. At the same time, the tapper 80 moves in thedirection away from the workpiece 70 at a speed corresponding to thetapper axial moving speed command Uz. Thus, the tapper 80 is brought tobe removed from the tapped hole (not shown) formed in the workpiece 70by the tapping.

Thereafter, when the tapper 80 is moved back to a predetermined returnposition, the drive of the second main spindle motor 21 and the thirdmotor 31 is stopped, so that the rotation and backward movement of thetapper 80 are stopped.

As discussed above, the second control circuit 120 is mainly comprisedof the second processor. Thus, the position loop control and the speedloop control, already explained with reference to FIG. 1 functionallyshowing the control unit 100, are implemented in the following manner bymeans of software processing executed by the second processor.

The second processor repeatedly carries out the processing shown in FIG.2 at intervals of the same cycle as the pulse distribution cycle ITP. Ineach cycle, the second processor multiplies the workpiece rotationalspeed command Vc sent from the NC unit 90 by a ratio m/n, to therebycalculate the tapper rotational speed command Vc(s) during the workpiecerotation (step S1). Then, the second processor determines whether or notthe rigid tapping command has been delivered from the NC unit 90, tothereby determine whether the tapping mode is selected or not (step S2).If the tapping mode is not selected, then the second processor resets aflag F to a value "0" (step S10), and executes the speed loop processing(step S9). As a result, the tapper 80 rotates at the same speed as theworkpiece rotational speed.

If it is determined at the step S2 in a later cycle that the tappingmode is selected, then the second processor determines whether the flagF has been set to a value "1" or not (step S3). If the value of the flagF is not "1",flag F is set to the value "1" (step S4). Next, the secondprocessor calculates an error pulse amount, corresponding to the tapperrotational speed command Vc(s) during the workpiece rotation which wascalculated in the step S1, and stores the calculation result in an errorregister ER (which corresponds to the error register 123 shown inFIG. 1) (step S5). The processor calculates a movement command valuecorresponding to the speed command Vc(s), and stores the calculationresult in the register R (step S6). Further, the second processorcalculates a movement command value corresponding to the tapping speedcommand Uv supplied from the NC unit 90, and adds the calculated valueto the stored value in the register R (step S7). Then, the secondprocessor reads a position feedback pulse amount in a corresponding oneITP cycle from the position counter 122, and subtracts the pulse amountfrom the stored value in the register R. The processor adds a storedvalue in the register R after the subtraction to the stored value in theerror register ER, and multiplies the resultant value by the positionloop gain PG, to thereby determine the speed command value (step S8).Next, the processor executes speed loop processing in accordance withthe speed command value determined by the position loop processing whichconsists of the aforementioned steps S5 to S8 (step S9). In thesubsequent cycles, the steps S1 to S3, and S6 to S9 are repeatedlyexecuted.

As a result, as is already explained with reference to FIG. 1, thetapper 80 installed on the second main spindle 20 rotates relative tothe workpiece 70 mounted on the first main spindle 10 at a speedcorresponding to the tapping speed command Uv. During the tapperrotation, the tapper 80 is axially moved toward the workpiece 70 asmentioned above, so that tapping is carried out, whereby a tapped holeis formed in the workpiece 70.

Upon completion of the tapping process, as is already explained withreference to FIG. 1, the tapping speed command and the tapper axialmoving speed command are set to the value "0, so that the tapper 80 isrotated at the same speed as the workpiece rotational speed, and theaxial movement of the tapper 80 is stopped. Thereafter, the tappingspeed command and the tapper axial moving speed command which are thesame in magnitude as and opposite in sign from those during the tappingprocess are delivered, so that the tapper 80 is removed from the tappedhole in the workpiece 70. When the end of the tapping mode is determinedat the step S2 of a cycle immediately after the completion of thetapping mode, the flag F is reset to the value "0."

What is claimed is:
 1. A control unit for use with a machine with atapping function which responds to a host controller by rotativelydriving a first main spindle adapted to be mounted with a workpiece by afirst motor, rotatively driving a second main spindle adapted to bemounted with a tapping tool by a second motor, and axially driving thesecond main spindle by a third motor, said control unit comprising:aposition detector coupled to the second main spindle for producing apositional feedback signal indicative of an actual rotational positionof the second main spindle; a first control circuit for controllingrotation of the first motor in accordance with a workpiece rotationalspeed command supplied from the host controller; a second controlcircuit for periodically executing position control processing inaccordance with the workpiece rotational speed command and a toolrotational speed command supplied from the host controller and thepositional feedback signal supplied from said position detector toperiodically calculate a second spindle rotational speed command duringworkpiece rotation, and for periodically executing speed controlprocessing in accordance with the second spindle rotational speedcommand to control rotation of the second motor; and a third controlcircuit for controlling rotation of the third motor in accordance with atool axial moving speed command supplied from the host controller andcorresponding to the tool rotational speed command.
 2. The control unitaccording to claim 1, wherein said second control circuit furtherincludes selection means for selecting one of a tapping mode where thespeed control processing is executed in accordance with the toolrotational speed command during the workpiece rotation calculated in theposition control processing and a speed control mode where the speedcontrol processing is executed in accordance with the workpiecerotational speed command, and the tapping mode is entered after thesecond main spindle is brought to rotate at the rotational speed of thefirst main spindle by execution of the speed control mode.
 3. Thecontrol unit according to claim 2,further comprising first and secondspeed detectors coupled to the first and second main spindles forsupplying first and second speed feedback signals, respectively; whereinsaid first control circuit is operable to control rotation of the firstmotor in accordance with the workpiece rotational speed command and thefirst speed feedback signal, indicative of an actual workpiecerotational speed, supplied from said first speed detector; and whereinsaid second control circuit is operable to control rotation of thesecond motor in accordance with one of the workpiece rotational speedcommand and the tool rotational speed command during the workpiecerotation calculated by the position control processing, and the secondspeed feedback signal, indicative of an actual tool rotational speed,supplied from said second speed detector.
 4. A method of controlling amachine with a tapping function, having a first spindle adapted to bemounted with a workpiece and rotatively driven by a first motor about arotational axis, and a second spindle adapted to be mounted with atapping tool, rotatively driven by a second motor around the rotationalaxis and driven by a third motor along the rotational axis, said methodcomprising the steps of:(a) producing a positional feedback signalindicative of an actual rotational position of the second spindle; (b)controlling rotation of the first motor in accordance with a workpiecerotational speed command; (c) periodically executing position control ofthe second spindle in a tapping control mode in accordance with thepositional feedback signal, the workpiece rotational speed command and atool rotational speed command indicating speed of the tapping toolrelative to the workpiece, to periodically obtain a second spindlerotational speed command during workpiece rotation; (d) periodicallyexecuting speed control processing to control rotation of the secondmotor in accordance with the second spindle rotational speed command;and (e) controlling the third motor to produce movement of the secondspindle along the rotational axis in accordance with a tool axial movingspeed command and corresponding to the tool rotational speed command. 5.A method according to claim 4, further comprising the steps of:(f)periodically executing speed control of the first and second spindlesindependently in a speed control mode; (g) periodically executing speedcontrol of the first and second spindles to produce rotation of thefirst and second spindles at substantially identical speeds prior toentering the tapping control mode; and (h) selecting between the speedand tapping control modes.
 6. A method according to claim 5,wherein saidexecuting in steps (d), (f) and (g) includes controlling the first motorin accordance with the workpiece rotational speed command and a firstspeed feedback signal, indicative of an actual workpiece rotationalspeed, supplied from a speed detector coupled to the first spindle, andwherein said executing in step (d) includes controlling the second motorin accordance with the workpiece and tool rotational speed commands anda second speed feedback signal, indicative of an actual tool rotationalspeed, supplied from a second speed detector coupled to the secondspindle.